<?php
function getAssignedArticles(){
	$c = connect();
	$r = mysql_query("SELECT * FROM submissions WHERE marker = '".$_SESSION['idusers']."'");
	$articles = array();
	while($row = mysql_fetch_assoc($r))
		array_push($articles, $row);

	return $articles;
}

function rating($articleid, $eventid, $rate, $comment){
	$c = connect();
	#Validate
	$r = mysql_query("SELECT * FROM submissions WHERE articles_idarticles = '".$articleid."'");
	if(mysql_num_rows($r) == 0){
		mysql_close($c);
		return false;
	}

	if($comment = "")
		$comment = "NULL";
	mysql_query("UPDATE submissions SET rate=.$rate , comment=$comment 
		WHERE articles_idarticles = $articleid AND events_idevents= $eventid");
	mysql_close($c);
	return true;
}

?>
